package com.zx.cloud.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
/**
 * @author Alex
 */
@Configuration
public class BeanConfiguration {

	@Bean
	public MappingJackson2HttpMessageConverter initializationMappingJackson2Htt() {
		System.out.println("---------------------------initializationMappingJackson2Htt---------------------------");
		MappingJackson2HttpMessageConverter converter=new MappingJackson2HttpMessageConverter();
		List<MediaType> supportedMediaTypes=new ArrayList<MediaType>();
		supportedMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
		supportedMediaTypes.add(MediaType.TEXT_HTML);
		supportedMediaTypes.add(MediaType.valueOf("text/json;charset=UTF-8"));
		converter.setSupportedMediaTypes(supportedMediaTypes);
		return converter;
	}
	
}
